def sock_pairs(pairs: int, cycles: int) -> int:
    cycle2 = cycles // 2
    cycle3 = cycles // 3
    cycle5 = cycles // 5
    cycle10 = cycles // 10
    total = pairs *2 -cycle2 + cycle3 - cycle5 + 2*cycle10
    return 0 if total < 0 else total // 2